Skip to content

Fix infinite loop in complex non-symmetric eigenvalue decomposition#1156

Open
su-senka wants to merge 1 commit into
mathnet:masterfrom
su-senka:fix/complex-evd-nonconvergence-guard
Open

Fix infinite loop in complex non-symmetric eigenvalue decomposition#1156
su-senka wants to merge 1 commit into
mathnet:masterfrom
su-senka:fix/complex-evd-nonconvergence-guard

Conversation

@su-senka

Copy link
Copy Markdown

Evd() hangs indefinitely on defective complex matrices (repeated eigenvalues), e.g. the 3×3 from #11. The non-symmetric Hessenberg-QR loop in the complex-valued algorithms has no iteration cap — it tries exceptional shifts at iter==10/20, but nothing terminates the loop if those don't resolve the degeneracy.

The real-valued Double/Single paths already guard this with iter >= 30*order -> throw NonConvergenceException. This change ports the same guard into the four missing complex-valued spots: UserEvd and ManagedLinearAlgebraProvider, for both Complex and Complex32.

Verified the affected complex paths now throw NonConvergenceException in a few ms instead of hanging, while the real-valued paths still converge correctly on the same matrix structure. Added a regression test per path (4 total).

Fixes #11.

The non-symmetric Hessenberg-QR eigenvalue loops for Complex and Complex32
had no iteration cap, so they could loop forever on defective matrices with
repeated eigenvalues (e.g. the 3x3 from mathnet#11). The real-valued Double/Single
versions already guard this with 'iter >= 30*order -> NonConvergenceException';
this ports the same guard into the four complex-valued spots (UserEvd and the
managed provider, for both Complex and Complex32), and adds regression tests
covering each path.

Fixes mathnet#11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

complex eigenvalue decomposition bug

1 participant